
// 随机生成uuid
export const generateUUID=()=> {
    var d = new Date().getTime();
    if (window.performance && typeof window.performance.now === "function") {
        d += performance.now(); //use high-precision timer if available
    }
    var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
        var r = (d + Math.random() * 16) % 16 | 0;
        d = Math.floor(d / 16);
        return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
    });
    return uuid;
}



// 测试token
export const testToken="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJqd3Rib2R5IiwidXNlciI6eyJjcmVhdGVUaW1lIjpudWxsLCJ1cGRhdGVUaW1lIjpudWxsLCJjcmVhdGVVc2VySWQiOiIzZGI3NDI1Yy05MTJhLTExZWItYjA0Ni0wYTgwZmYyNjAzZGUiLCJ1cGRhdGVVc2VySWQiOm51bGwsImNyZWF0ZVVzZXIiOm51bGwsImlkIjoiM2RiNzQyYzAtOTEyYS0xMWViLWIwNDYtMGE4MGZmMjYwM2RlIiwidXNlcm5hbWUiOiJodWFuZ2NoZW5qaWUiLCJuaWNrbmFtZSI6Ium7hOmZiOadsCIsInBhc3N3b3JkIjoiNWYxMTRhN2MxMGYwZTU1MDZlOGIwNzIwMDE1M2Q5NzMiLCJzdGF0ZSI6dHJ1ZSwiaXNTU09Mb2dpbiI6ZmFsc2UsInVzZXJBY2Nlc3MiOltdLCJlbWFpbCI6bnVsbCwidGVuYW50SWQiOiJhYzQyODI3MC05MTE4LTExZWItOTQyNy0wYTgwZmYyNjAzZGUiLCJ0ZW5hbnROYW1lIjpudWxsfSwiaWF0IjoxNjE5MTY0ODc5LCJleHAiOjE2MTk3Njk2Nzl9.MydRsndNQF2DAhqiDyP8dajytVRP8wY_nYKOzlAwtTo"

// 获取路由参数
export const getUrlKey=(name,url) =>{
  return decodeURIComponent((new RegExp('[?|&]'+name+'='+'([^&;]+?)(&|#|;|$)').exec(url)||[,""])[1].replace(/\+/g,'%20'))||null;
}
